<?php
/**
 * Created by PhpStorm.
 * User: tsy
 * Date: 2016/7/13
 * Time: 14:26
 */
namespace Admin\Model;
use Think\Model;

class FacilitatorModel extends Model{
    protected $trueTableName = 'bypal_facilitator_info';
    /**
     * 查询所有商户信息
     * @return mixed
     */
    public function select_facilitator_info($fac_name){
        $sql="select t1.id,t1.fac_account,t1.fac_simple_name,t2.name,t1.fac_corporation_email,t1.fac_corporation_phone from bypal_facilitator_info t1
        left join bypal_facilitator_itype t2 on t1.fac_separatetype=t2.trade_number where 1=1";

        if($fac_name!=''){
            $sql.=" and t1.fac_simple_name like '%$fac_name%'";
        }

        $Model = new \Think\Model();
        $values=$Model->query($sql);
        return $values;
    }
}